package cn.ording.util;


import org.hibernate.Query;
import org.hibernate.Session;

public abstract class QueryFactory {
	public final static String QUERY_METHOD_SQL = "sql"; 
	public final static String QUERY_METHOD_HQL = "hql"; 
	public static Query getQuery(Session session ,String select ,String method){
		if("sql".equals(method)){
			return session.createSQLQuery(select);
		}else if("hql".equals(method)){
			return session.createQuery(select);
		}else{
			return null;
		}
	}
}
